package main

import "fmt"

func main() {
	slice := []int{1, 2, 3, 4, 5}
	fmt.Printf("Original slice is: %v\n", slice)
	rotate(slice, 2)
	fmt.Printf("After rotate slice is: %v\n", slice)
}

func rotate(slice []int, shift int) {
	newSlice := make([]int, len(slice))
	for i, v := range slice {
		newSlice[(shift+i)%len(slice)] = v
	}
	copy(slice, newSlice)
}
